﻿using UnityEngine;
using System.Collections;

public class anim_cont : MonoBehaviour {
    Animator ani;
	void Start () {
        ani = GetComponent<Animator>();
	}
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(KeyCode.Alpha1))   //idle
        {
            //ani.SetBool("idle_walk",false);
            //ani.SetBool("idle_run", false);
            //ani.SetBool("idle_jump", false);
            ani.SetInteger("anim_int", 1);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))  //walk
        {
            //ani.SetBool("idle_walk", true);
            //ani.SetBool("walk_run", false);
            //ani.SetBool("walk_jump", false);
            ani.SetInteger("anim_int", 2);
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))   //run
        {
            //ani.SetBool("idle_run", true);
            //ani.SetBool("walk_run", true);
            //ani.SetBool("run_jump", false);
            ani.SetInteger("anim_int", 3);
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))   //jump
        {
            //ani.SetBool("idle_jump", true);
            //ani.SetBool("run_jump", true);
            //ani.SetBool("walk_jump", true);
            ani.SetInteger("anim_int", 4);
        }
    }

    public void idle()
    {
        ani.SetInteger("anim_int", 1);
    }
    public void walk()
    {
        ani.SetInteger("anim_int", 2);
    }
    public void run()
    {
        ani.SetInteger("anim_int", 3);
    }
    public void jump()
    {
        ani.SetInteger("anim_int", 4);
    }
}
